package cn.tedu._04mybatis.mapper;

import cn.tedu._04mybatis.pojo.entity.Weibo;
import cn.tedu._04mybatis.pojo.vo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
    //@Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{created},#{user_id})")
    int insertWeibo(Weibo weibo);
    //@Delete("DELETE FROM weibo WHERE id=#{weiboId}")
    int deleteWeibo(Long weiboId);

    //@Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{user_id} WHERE id=#{id}")
    int updateWeibo(Weibo weibo);

    //@Select("SELECT id,content,created,user_id FROM weibo WHERE id=#{weiboId}")
    Weibo selectWeiboById(Long weiboId);
    //@Select("SELECT id,content,created,user_id FROM weibo")
    List<Weibo> selectWeibo();

    //@Select("SELECT content,created FROM weibo WHERE id=#{weiboId}")
    SelectWeiboVO1 selectWeiboVO1(Long weiboId);

    //@Select("SELECT content,created FROM weibo WHERE user_id=#{user_Id}")
    List<SelectWeiboVO2> selectWeiboVO2(Long user_Id);

    int dynamicUpdateWeibo(Weibo weibo);

    int dynamicDeleteWeibo1(Long[] ids);

    int dynamicDeleteWeibo2(List<Long> ids);

    int selectCount();

    ResultMapVO1 selectResultMapVO1(Long weiboId);

    ResultMapVO2 selectResultMapVO2(Long userId);

    ResultMapVO3 selectResultMapVO3(Long weiboId);

    ResultMapVO4 selectResultMapVO4(Long weiboId);
}
